<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>


        <div class="table-box tablenes">
            <div class="title">销售方信息</div>
            <table class="layui-table">
                <tbody>
<!--                <tr><td class="tt">销售方(乙方)</td><td id="gonger" class="tv"></td><td class="tt">销售方(乙方)联系电话</td><td id="gongtel" class="tv"></td></tr>-->
                <tr><td class="tt">销售方联系人</td><td id="lianer" class="tv" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>


        <div class="table-box tablenes">
            <div class="title">合同信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">合同名称</td><td id="name" class="tv"></td><td class="tt">合同编号</td><td id="number" class="tv"></td></tr>
                <tr><td class="tt">采购类型</td><td id="caitype_name" class="tv"></td><td class="tt">合同类型</td><td id="hetype_name" class="tv"></td></tr>
                <tr><td class="tt">合同金额(元)</td><td id="money" class="tv"></td><td class="tt">合同份数</td><td id="henum" class="tv"></td></tr>
                <tr><td class="tt">发票类型</td><td id="qianpiaotype_name" class="tv"></td><td class="tt">税率(%)</td><td id="rate" class="tv"></td></tr>
                <tr><td class="tt">供应方(乙方)</td><td id="gonger" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">购买方(甲方)</td><td id="caier_name" class="tv"></td><td class="tt">签订状态</td><td id="state_name" class="tv"></td></tr>
                <tr><td class="tt">签订日期</td><td id="qiandt" class="tv"></td><td class="tt">签订人</td><td id="myer" class="tv"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>


        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo">
                进项票明细
            </script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>


        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>



        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_contract_chu_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;




                $("#lianer").html(data.lianer);
                $("#state_name").html(data.state_name);
                $("#name").text(data.name);
                $("#number").text(data.number);
                $("#caitype_name").text(data.caitype_name);
                $("#hetype_name").text(data.hetype_name);
                $("#qianpiaotype_name").text(data.qianpiaotype_name);
                $("#caier_name").text(data.caier_name);
                $("#gonger").text(data.gonger);
                $("#henum").text(data.henum);
                $("#myer").text(data.myer);
                $("#gongtel").text(data.gongtel);
                $("#qiandt").text(data.qiandt);
                $("#money").text(parseFormatNum(data.money));
                $("#rate").text(data.rate);
                $("#explain").text(data.explain);


                var mytableList = table.render({
                    elem: "#datalist",data:res.data.list, toolbar: '#toolbarDemo', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号'}
                        ,{field: 'nums', title: '发票号码'}
                        ,{field: 'qianpiaotype_name', title: '发票类型'}
                        ,{field: 'kaidt', title: '开票日期'}
                        ,{field: 'cailei', title: '材料总类'}
                        ,{field: 'fee', title: '不含税金额(元)'}
                        ,{field: 'rate', title: '税率(%)'}
                        ,{field:'listratefee',title:'税额(元)',templet: function(d){
                                return parseFormatNum(d.listratefee);
                            }}
                        ,{field:'listmoney',title:'价税合计(元)',templet: function(d){
                                return parseFormatNum(d.listmoney);
                            }}
                        ,{field: 'statename', title: '付款状态'}
                        ,{field:'yifufee',title:'累计已付款金额(元)',templet: function(d){
                                return parseFormatNum(d.yifufee);
                            }}
                        ,{field:'daifufee',title:'待付款金额(元)',templet: function(d){
                                return parseFormatNum(d.daifufee);
                            }}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });


                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('contract_chu', param_id);
    });

    function show_contractbian(id) {
        openPage('../contract_bian/show.php?id='+id);
    }




</script>
</body>
</html>




